package model.objects;

import java.awt.Rectangle;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

import model.general.LoadImage;
import model.general.Location;
import model.general.Util;

public abstract class Sprites {

	protected Location location;
	protected String srcImgLeft;
	protected String srcImgRight;
	protected BufferedImage img;
	protected Rectangle rect;
	protected LoadImage loadImage = new LoadImage();
	protected JPanel pnl;
	protected int width = Util.DEFAULT_WIDTH, height = Util.DEFAULT_HEIGHT;

	public Sprites(Location location, String srcImgLeft, String srcImgRight, JPanel pnl) {
		this.location = location;
		this.srcImgLeft = srcImgLeft;
		this.srcImgRight = srcImgRight;
		this.img = loadImage.getbufferImage(srcImgLeft);
		this.width = img.getWidth();
		this.height = img.getHeight();
		this.pnl = pnl;
		rect = new Rectangle(this.location.getX(), this.location.getY(), width, height);
	}

	public Rectangle getBounds() {
		rect = new Rectangle(this.location.getX(), this.location.getY(), width, height);
		return rect;
	}

}
